<template>
  <a-modal :visible="visible" :destroyOnClose="true" title="新建" :footer="false" @cancel="visible = false">
    <div style="width:100%">
      <label for="" style="margin-right:12px">请选择活动场景：</label>
      <a-select v-model="addType" placeholder="请选择" :getPopupContainer="triggerNode => triggerNode.parentNode" style="width:200px">
        <a-select-option :value="item.code" v-for="(item, index) in sceneList" :key="index" :disabled="item.code != 1">{{ item.name }}</a-select-option>
      </a-select>
    </div>
    <div class="btn">
      <a-button style="margin-right:12px" @click="visible = false">取消</a-button>
      <a-button type="primary" @click="handleAdd">确定</a-button>
    </div>
  </a-modal>
</template>
<script>
export default {
  props: ['sceneList'],
  data() {
    return {
      visible: false,
      addType: ''
    }
  },
  methods: {
    show() {
      this.addType = ''
      this.visible = true
    },
    handleAdd() {
      if (this.addType) {
        this.$router.push(`/box/operations/marketing-activity/activity-edit/${this.addType}/add`)
        this.visible = false
      } else {
        this.$message.warning('请选择活动场景')
      }
    }
  }
}
</script>
<style lang="less" scoped>
.btn {
  width: 100%;
  text-align: center;
  margin-top: 24px;
}
</style>

